package com.itheima.objectDemo;

public class EqualsDemo {
    public static void main(String[] args) {
        String s = "abc";
        StringBuilder sb = new StringBuilder("abc");

        /*
        * String.equals先判断类型，String != StringBuilder
        * */
        System.out.println(s.equals(sb)); // false
        /*
         * StringBuilder类没有equals方法，默认比较地址值
         * */
        System.out.println(sb.equals(s)); // false
    }
}
